<?php
/**
 * Admin_Form_
 * @author Martin Skála
 */

class Admin_Form_Autor extends Zend_Form
{

    public function init()
    {
        $this->setName('autor');

        $id = new Zend_Form_Element_Hidden('id_autora');
        $id->addFilter('Int');

        $jmeno = new Zend_Form_Element_Text('jmeno');
        $jmeno->setLabel('Jméno')
                ->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty');

        $prijmeni = new Zend_Form_Element_Text('prijmeni');
        $prijmeni->setLabel('Příjmení')
                ->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty');

        $narozeni = new Zend_Form_Element_Text('narozeni');
        $narozeni->setLabel('Narození')
                ->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty');

        $odeslat = new Zend_Form_Element_Submit('submit');
        $odeslat->setAttrib('id_autora', 'submitbutton');

        $this->addElements(array($id, $jmeno, $prijmeni, $narozeni, $odeslat));

    }

}